﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.KH.Contract;
using MaxLeaf.KH.DALImplementation;
using CommonsLib.Utility;
using MaxLeaf.KH.DataContract;
using CommonsLib.Settings;

namespace MaxLeaf.KH.DALProxy
{
    public class TestDALProxy : BaseDALProxy, ITest
    {
        ITest dal;
        public TestDALProxy():base()
        {
            switch ( Access_Mode )
            {
                
                case MaxLeaf.Commons.Enum.ACCESS_Direct:
                    {
                        dal = new TestDAL();
                        break;
                    }

                case MaxLeaf.Commons.Enum.ACCESS_IIS:
                    {
                        dal = new TestDALWCFClient(this.WCF_Configs);
                        break;
                    }

                 
                default: throw new Exception(MaxLeaf.Commons.Const.EXCEPTION_MESSAGE_INVALID_ACCESSMODE_CONFIG);
            }
        } 

        public TestModel SayHello(TestModel user)
        {
            LogManager.Debug("DALProxy SayHello ");

             
                return dal.SayHello(user);
             
           
        }

        public string ShowError(string strName)
        {
             
                return dal.ShowError(strName);
             
             
        }

        #region ITest 成员


        public List<object> SelectDtl(TestModel user)
        {
            return dal.SelectDtl(user);
        }

        #endregion
    }
}
